package functional_programming;
interface IntCall {
    int call(int arg);
}
public class RecursiveFibonacci {
    IntCall fib;
    RecursiveFibonacci() {
        fib = (n) ->
            n == 0 ?
                0 : n == 1 ?
                1 : fib.call(n - 1) + fib.call(n - 2);


    }
    public static void main(String[] args) {
        RecursiveFibonacci rc = new RecursiveFibonacci();
        for (int i = 0; i < 10; i++) {
            System.out.println(rc.fibonacci(i));
        }
    }
    int fibonacci(int n) { return fib.call(n); }



}
